// __PUBLIC__/js/page/cms/article/contentlistdialog
require(['../../common'], function() {
  require(['article.contentlistdialog'])
})

define('article.contentlistdialog', [
  'jquery',
  'page/grid'
], function($, Grid) {
  'use strict';

  var $table = $('.table')
  var mygrid = new Grid($table)
  mygrid.init();

  function loadFrame(url) {
    $(window.parent.document).find("#content-frame").attr("src", url)
  }

  $(document)
    .on('click', '.pager a', function(e) {
      loadFrame($(this).data('url'))
    })
    .on('click', '#J_search', function(e) {
      var sid = $('#siteid').val()
      var vcid = $("#dialog_dialog_cid").val()
      var vtitle = $("#dialog_title").val()
      var url = APP + '?app=cms&m=Article&a=contentlistdialog&siteid=' + sid + '&cid='+vcid+'&title=' + vtitle
      loadFrame(url)
    })
})